import type { RouteRecordRaw } from "vue-router";
import { getRoutePaths } from "../lib/index";
import TaskView from "@/views/taskView/index.vue";
import TestView from "@/views/testView/index.vue";
import Adjust from "@/views/adjust/index.vue";
import DeviceView from "@/views/deviceView/index.vue";
import UserView from "@/views/userView/index.vue";
import Setup from "@/views/setup/index.vue";

const routes: RouteRecordRaw = {
  path: "/",
  component: () => import("@/layout/index.vue"),
  name: "Web",
  meta: {
    name: "Web",
    icon: "menu-icon-web"
  },
  redirect: "/taskView",
  children: [
    {
      path: "/taskView",
      name: "TaskView",
      meta: {
        name: "任务",
        icon: "menu-icon-task"
      },
      component: TaskView,
      // component: () => import("@/views/public/test-view.es"),
      children: [
        {
          path: "/addTask",
          name: "AddTask",
          meta: {
            name: "新增任务",
            activeMenu: "/taskView",
            icon: "menu-icon-task"
          },
          component: () => import("@/views/taskView/addTask/indev.vue")
        }
      ]
    },
    {
      path: "/testView",
      name: "TestView",
      meta: {
        name: "测试",
        tabType: "multiple",
        icon: "menu-icon-test"
      },
      component: TestView
    },
    {
      path: "/adjust",
      name: "AdjustView",
      meta: {
        name: "校准",
        icon: "menu-icon-adjust"
      },
      component: Adjust
    },
    {
      path: "/deviceView",
      name: "DeviceView",
      meta: {
        name: "设备",
        icon: "menu-icon-debug"
      },
      component: DeviceView
    },
    {
      path: "/userView",
      name: "UserView",
      meta: {
        name: "用户",
        icon: "menu-icon-user"
      },
      component: UserView
    },
    {
      path: "/setup",
      name: "SetupView",
      meta: {
        name: "帮助",
        icon: "menu-icon-setup"
      },
      component: Setup
    }
  ]
};
// verifyRoutesCompliance(routes);
const routePaths = { [routes.name!]: getRoutePaths(routes) };
export { routePaths };
export default routes;
